package com.financing.wap.common;

import java.util.HashMap;
import java.util.Map;

import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 * ajax 返回封装类
 * @author hetaihe
 */
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class ResultMap {
	
	public enum STATUS{
		SUCCESS,FAILE,ERROR,WARN,NEED_LOGIN
	}

	private String statusCode;
	/**
	 * 状态
	 */
	private STATUS status = STATUS.FAILE;
	
	/**
	 * 提示语
	 */
	private String message="";
	
	/**
	 * 属性
	 */
	private Map<String, Object> attributes = new HashMap<String, Object>();
	
	
	/**
	 * 正常成功
	 */
	public static final String STATUS_CODE_SUCCESS = "0000";
	/**
	 * 网络异常
	 */
	public static final String STATUS_CODE_NETWORK_ERROR = "1001";
	/**
	 * 链接超时
	 */
	public static final String STATUS_CODE_TIMEOUT = "1002";
	/**
	 * 未登录
	 */
	public static final String STATUS_CODE_ONLOGIN = "2001";
	/**
	 * 参数缺失
	 */
	public static final String STATUS_CODE_PARAMETERS_LOSE = "2002";
	/**
	 * 参数类型错误
	 */
	public static final String STATUS_CODE_PARAMETERS_TYPE_ERROR = "2003";
	/**
	 * 请求对象不存在
	 */
	public static final String STATUS_CODE_OBJECT_NOFOUNT = "2004";
	
	/**
	 * 身份认证不通过
	 */
	public static final String STATUS_CODE_AUTHENTICATION_ERROE = "2005";
	
	/**
	 * 违法操作
	 */
	public static final String STATUS_CODE_OPERATE_ERROE = "2006";
	
	/**
	 * 重名验证错误
	 */
	public static final String STATUS_CODE_RENAME_ERROE = "2007";
	/**
	 * 参数校验不通过
	 */
	public static final String STATUS_CODE_PARAMETERS_VALIDATE_ERROR = "2008";
	
	/**
	 * 帐户名密码错误
	 */
	public static final String STATUS_CODE_PWS_ERROR = "2009";
	
	/**
	 * OTP校验失败
	 */
	public static final String STATUS_CODE_OTP_VALIDATE_ERROR = "2010";
	

	
	/**
	 * 注册手机号已被使用
	 */
	public static final String STATUS_CODE_MOBILE_NUMBER_CONFLICT = "2011";
	
	/**
	 * 账户已经被禁用
	 */
	public static final String STATUS_CODE_ACCOUNT_DISABLE = "2012";
	
	/**
	 * 密码错误
	 */
	public static final String STATUS_CODE_USER_PASSWORD_ERROR = "2013";
	
	/**
	 * 手机号在本系统中不存在
	 */
	public static final String STATUS_CODE_MOBILE_NUMBER_UNDEFINED = "2014";
	
	/**
	 * 输入原卡号错误
	 */
	public static final String STATUS_CODE_CARD_UNMBER_ERROR = "2015";
	
	/**
	 * 提现账户不允许重复添加（每个人只有一个支付宝和一个银行卡）
	 */
	public static final String STATUS_CODE_CARD_TYPE_NOTONLY = "2016";
	
		/**
	 * 不能重复订阅信息
	 */
	public static final String STATUS_CODE_SUBSCRIBE_NUMBER_CONFLICT = "2017";
	
	/**
	 * 账户已经被拉黑
	 */
	public static final String STATUS_CODE_ACCOUNT_BLACK = "2018";
	
	/**
	 * 提现账户卡号已经添加过
	 */
	public static final String STATUS_CODE_CARD_UNMBER_NOTONLY = "2019";
	
	
	/**
	 * 用户未审核通过
	 */
	public static final String STATUS_CODE_USER_CHECK_NOT_PASS = "2020";

	/**
	 * 用户交易密码锁定
	 */
	public static final String STATUS_CODE_USER_STATUS_TRADE_LOCK = "2021";
	
	/**
	 * 金融相亲活动已经参加过
	 */
	public static final String STATUS_CODE_2022 = "2022";

	/**
	 * 融云token 空
	 */
	public static final String STATUS_CODE_2023 = "2023";
	
	
	/**
	 * shop认证信息查询异常
	 */
	public static final String STATUS_CODE_2024 = "2024";
	
	
	/**
	 * shop产品已下架
	 */
	public static final String  PRODUCT_DOWN= "2025";
	
	
	/**
	 * 订单购买金额不在区间内
	 */
	public static final String STATUS_CODE_AMOUNT_NOT_IN_RANGE = "2301";
	/**
	 * 订单购买金额小于起购金额
	 */
	public static final String STATUS_CODE_AMOUNT_MIN_ERROR = "2302";
	/**
	 * 订单购买金额大于预售金额
	 */
	public static final String STATUS_CODE_AMOUNT_MAX_ERROR = "2303";
	
	/**
	 * 累进金额错误
	 */
	public static final String STATUS_CODE_AMOUNT_PROGRESSIVE_ERROR = "2304";
	
	/**
	 * 订单编号生成错误
	 */
	public static final String ORDER_CODE_CREATE_ERROR = "2305";
	
	/**
	 * 不在销售时间内
	 */
	public static final String ORDER_CODE_NOT_SALES_TIME = "2306";
	
	
	/**
	 * 机构不能预约
	 */
	public static final String ORDER_ORG_NOT_APPLY = "2307";
	/**
	 * 系统掷出类异常
	 */
	public static final String STATUS_CODE_SYS_EXCEPTION = "3001";
	
	/**
	 * 发送邮件失败
	 */
	public static final String STATUS_EMAIL_SHARE_EXCEPTION = "3002";
	/**
	 * 登陆验证码错误
	 */
	public static final String LOGIN_VERIFYCODE_ERROR = "2101";
	/**
	 * 登陆验证码发送失败
	 */
	public static final String VERIFYCODE_SEND_ERROR = "2103";
	/**
	 * 未登录
	 */
	public static final String LOGIN_NOLOGIN_ERROR = "2102";
	/**
	 * OTP校验失败-验证码超时
	 */
	public static final String STATUS_CODE_OTP_VALIDATE_ERROR_TIMEOUT = "2110";
	
	/**
	 * 获取OTP校验失败-手机号为空
	 */
	public static final String STATUS_CODE_OTP_VALIDATE_ERROR_NULL = "2120";
	
	/**
	 * OTP获取太频繁
	 */
	public static final String STATUS_CODE_OTP_BUSY_ERROR = "2130";

	/**
	 * 返回的产品对象异常
	 */
	public static final String STATUS_CODE_RETURNBOJECT_ERROR = "2201";
	/**
	 * 提现额度大于可提现额度
	 */
	public static final String STATUS_CODE_WITHDRAW_AMOUNT_TOO_BIG = "2202";
	/**
	 * 产品已经点赞
	 */
	public static final String STATUS_CODE_PRODUCT_ALREADY_UP= "2213";

	/**
	 * 活动未开始或已过期
	 */
	public static final String ACTIVITIES_DATE_IS_OUT = "2400";
	/**
	 * 没有SOURCE_CODE
	 */
	public static final String STATUS_CODE_NO_SOURCE_CODE = "2401";
	
	/**
	 * 活动参与人数已满
	 */
	public static final String STATUS_CODE_JOIN_PERSON_FULL = "2402";
	/**
	 * 活动报名时间已经结束
	 */
	public static final String STATUS_CODE_ACTIVITIES_REGISTTIME_END = "2403";
	
	/**
	 * 调研问卷活动-分数未找到
	 */
	public static final String STATUS_CODE_ACTIVITIES_NO_SCORE = "2404";
	
	/**
	 * 调研问卷活动-一份答案多次提交
	 */
	public static final String STATUS_CODE_ACTIVITIES_ANSWER_RESUBMIT = "2405";
	
	/**
	 * 调研问卷活动-已经参与过此调查
	 */
	public static final String STATUS_CODE_ACTIVITIES_HAS_JOIN = "2406";
	
	/**
	 * 调研问卷活动-没有答案
	 */
	public static final String STATUS_CODE_ACTIVITIES_NO_ANSWER = "2407";
	
	/**
	 * 调研问卷活动-已经参与过此调查，单未登录领取
	 */
	public static final String STATUS_CODE_ACTIVITIES_HAS_JOIN_NO_LOGIN = "2408";
	
	/**
	 * 发财指数活动-已经参与过此活动
	 */
	public static final String STATUS_CODE_ACTIVITIES_FCZS_HAS_JOIN_OPENID = "2410";
	
	/**
	 * 产品不在预约范围内
	 */
	public static final String SALE_STATUS_BUKEYUYUE_FAILE = "2411";
	
	/**
	 * 组团数超限
	 */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_OVER_LIMIT = "2420";
    
    /**
     * 团队不存在
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_NOT_EXIS = "2421";
    
    /**
     * 团队成员已满
     */
    public static final String STATUS_CODE_ACTIVIITES_GROUP_FULL = "2422";
    
    /**
     * 还有正在进行中的团
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_RUNNING = "2423";
    
    /**
     * 组团超时
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_TIME_OUT = "2424";
    
    /**
     * 组团失败结束
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_FAIL_END = "2425";
    
    /**
     * 已经加入团队
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_IN_GROUP = "2426";
    
    /**
     * 团队总人数错误
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_TOTAL_MEMBER_ERROR = "2427";
    
    /**
     * 已注册认证通过无法加团
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_HAD_AUTHENTICATION = "2428";
    
    /**
     * 红包已拆
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_RED_ERROR = "2429";
    
    /**
     * 红包状态异常
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_RED_STATUS_ERROR = "2430";
    
    /**
     * 没有可拆红包
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_NO_RED = "2431";
    
    /**
     * 未关联微信
     */
    public static final String STATUS_CODE_ACTIVITIES_GROUP_NO_BINDING_WECHAT = "2049";
	
	/**
	 * 产品已经收藏
	 */
	public static final String STATUS_CODE_PROJECT_LIKE_EXIST = "2501";
	
	/**
	 * 没有文件上传
	 */
	public static final String STATUS_CODE_NO_FILE_UPLOAD = "2601";
	
	/**
	 * 上传文件类型错误
	 */
	public static final String STATUS_CODE_FILE_TYPE_ERROR = "2602";
	
	/**
	 * 文件保存路径异常
	 */
	public static final String STATUS_CODE_SAVE_FILE_DIR_ERROR="2603";
	
	/**
	 * 客户名下有订单，无法删除
	 */
	public static final String STATUS_CODE_HVAE_ORDER_ERROR="2701";
	
	/**
	 * 微信-获取code错误
	 */
	public static final String STATUS_CODE_WECHAT_CODE_ERROR="2801";
	

	/**
	 * 微信-获取access_token错误
	 */
	public static final String STATUS_CODE_WECHAT_ACCESS_TOKEN_ERROR="2802";
	
	/**
	 * 微信-获取用户信息错误
	 */
	public static final String STATUS_CODE_WECHAT_USERINFO_ERROR="2803";
	
	/**
	 * 微信-需要关联用户
	 */
	public static final String STATUS_CODE_WECHAT_ASSOCIATED_USER_ERROR="2804";
	
	/**
	 * 微信-关联失败
	 */
	public static final String STATUS_CODE_WECHAT_RELATION_ERROR="2805";
	
	/**
	 * 微信-用户已经关联
	 */
	public static final String STATUS_CODE_WECHAT_ALREADY_USER_ERROR="2806";
	
	/**
	 * 微信-openid已经关联
	 */
	public static final String STATUS_CODE_WECHAT_ALREADY_OPENID_ERROR="2807";
	
	
	/**
	 * 微信-发红包异常
	 */
	public static final String STATUS_CODE_WECHAT_RED_PACK_ERROR="2810";
	
	/**
	 * 微信-openid已经关联
	 */
	public static final String STATUS_CODE_FUND_INFO_NOTPUB_ERROR="2203";
	

	/**
	 *审核通过禁止修改
	 */
	public static final String STATUS_CODE_PROHIBITION_MODIFY="2204";
	
	/**
	 *未发布禁止修改
	 */
	public static final String STATUS_CODE_NOT_PUBLIC="2205";
	/**
	 *单期规模不能大于发行规模
	 */
	public static final String STATUS_CODE_PARAM_ERROR="2206";
	/**
	 *非募集中不能修改募集进度
	 */
	public static final String STATUS_CODE_NOT_UPDATE="2208";
	
	/**
	 *邮箱不正确
	 */
	public static final String STATUS_CODE_EMAIL_ERROR = "2209";
	/**
	 *产品类型不存在
	 */
	public static final String STATUS_CODE_PROTYPE_NOT_EXIST = "2210";
	/**
	 *对比产品类型不一致
	 */
	public static final String STATUS_CODE_PROTYPE_DIFFER = "2211";
	
	/**
	 * 产品视屏地址获取异常
	 */
	public static final String STATUS_CODE_PROVIDEO_ERROR = "2212";
	
	/*** 1XXX 网络通讯错误，2xxx业务逻辑错误，3xxx系统抛出异常. 4xxx 支付***/
	/*** 20xx公用，21xx用户相关及登录，22xx产品相关  23xx订单  24xx活动相关 25xx收藏    28xx微信 26×× 活动用***/

	/**
	 * 产品已经订阅
	 */
	public static final String STATUS_CODE_PROJECT_SUB_EXIST = "2502";
	
	/**
	 * 活动红包已领
	 */
	public static final String STATUS_CODE_GIFT_HAS_BROUGHT = "2901";
	
	/**
	 * 活动时间已结束
	 */
	public static final String STATUS_CODE_ACTIVITIES_END_TIME = "2902";
	
	/**
	 * 活动奖金已抽完
	 */
	public static final String STATUS_CODE_ACTIVITIES_EMPTY = "2903";
	
	/**
	 * 重复添加产品
	 */
	public static final String REPEAT_ADD="5001";
	
	
	public static final String STATUS_CODE_TIED_CARD = "4001";//支付-此前已经绑卡
	public static final String STATUS_CODE_BANKCARD_BY_OTHER= "4002";// 支付-银行卡已被他人绑定
	public static final String STATUS_CODE_IDCARD_BY_OTHER= "4003";//支付-身份证已被他人绑定
	public static final String STATUS_CODE_BANKCARD_BOUND= "4004";//支付-银行卡已被绑定
	public static final String STATUS_CODE_DOES_NOT_SET_BANKINFO= "4005";//支付-未设置对应的银行信息
	public static final String STATUS_CODE_4006= "4006";//支付-交易密码和登录密码不能一样
	public static final String STATUS_CODE_4007= "4007";//支付-还未绑定银行卡
	public static final String STATUS_CODE_4008= "4008";//支付-交易密码不存在
	public static final String STATUS_CODE_4009= "4009";//支付-新旧密码不能一致
	public static final String STATUS_CODE_4010= "4010";//支付-旧交易密码不正确
	public static final String STATUS_CODE_4011= "4011";//支付-交易密码不正确
	public static final String STATUS_CODE_4012= "4012";//支付-绑卡失败
	public static final String STATUS_CODE_4013= "4013";//支付-订单状态已经支付
	public static final String STATUS_CODE_4014= "4014";//支付-支付失败
	public static final String STATUS_CODE_4015= "4015";//支付-支付失败
	public static final String STATUS_CODE_4016= "4016";//支付-绑卡数量超出
	public static final String STATUS_CODE_4017= "4017";//支付-该银行卡不存在
	
	
	/**
	 * 返佣有异常，必须有一条大于当前佣金
	 */
	public static final String STATUS_CODE_REBATE_ERROR = "3100";
	
	/**
	 * 返佣不能小于官网报价
	 */
	public static final String STATUS_CODE_REBATE_MIN = "3101";
	
	
	/**
	 * 保证金错误
	 */
	public static final String STATUS_CODE_AMOUNT_ERROR = "3102";
	
	
	/**
	 * 返佣比例缺失
	 */
	public static final String STATUS_CODE_REBATE_LOSE = "3103";
	
	/**
	 * 返佣比例最多支持两位小数
	 */
	public static final String STATUS_CODE_REBATE_TWO = "3104";
	
	/**
	 * 协议价不能竞价
	 */
	public static final String STATUS_CODE_REBATE_ISAGREEMENT = "3105";
	/**
	 * 产品不能竞价
	 */
	public static final String STATUS_CODE_CANNOT_BID = "3106";
	
	/**
	 * 产品重复添加
	 */
	public static final String STATUS_CODE_REPEAT_ADD = "3107";
	
	/**
	 * 开始时间必须小于结束时间
	 */
	public static final String STATUS_CODE_START_LESS_END_DATE = "3200";
	
	/**
	 * 开始时间结束时间格式错误
	 */
	public static final String STATUS_CODE_DATE_FOMART_ERROR = "3201";
	
	/**
	 *重复报名活动
	 */
	public static final String STATUS_CODE_ACTIVITY_REPEAT_ADD = "3108";
	
	/**
	 *不在销售抽奖名单中
	 */
	public static final String STATUS_CODE_4108 = "4108";
	/**
	 *没有抽奖机会
	 */
	public static final String STATUS_CODE_4109 = "4109";
	/**
	 *没有奖项了
	 */
	public static final String STATUS_CODE_4110 = "4110";
	
	public Object getAttribute(String key){
		return attributes.get(key);
	}
	
	public void setAttribute(String key, Object value){
		attributes.put(key, value);
	}
	
	public STATUS getStatus() {
		return status;
	}

	public void setStatus(STATUS status) {
		this.status = status;
	}

	public String getMessage() {
		return null;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Map<String, Object> getAttributes() {
		return attributes;
	}

	public void setAttributes(Map<String, Object> attributes) {
		this.attributes = attributes;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}
	
	
}
